<template>
  <div v-if="item">
  id:   {{id}} <br>
  title:  {{item.title}}   <br>
         <!--图片懒加载-->
          <img v-lazy="item.img"/>
  </div>
</template>
<script>
import axios from 'axios';
export default {
    data(){
        return {
          id:0,
          item:{},
          list:[]
        }
    },
    created(){
        this.id=this.$route.params.id;
        axios.get('/api/list').then((res)=>{
        this.list=res.data.data.list;
        this.list.forEach((item)=>{
            if(item.id===this.id){
                this.item=item;
            }
        })
       
      })
       
    },
   
}
</script>